<?php use_helper('Javascript') ?>

<?php echo input_tag(
                'text_module[text_layout_id]'
                , $text_module->getTextLayoutId()
                , array(
                    'size' => '1'
                )
            ) ?>

<?php foreach($arLayouts as $obj): ?>
    <?php echo link_to_function(image_tag($obj->getName() . '.png'), 'SetTextLayout(' . $obj->getId() . ')') ?>
<?php endforeach; ?>
<?php echo javascript_tag(

"
function SetTextLayout(id)
{
    $('text_module_text_layout_id').value = id;
}
"

) ?>